import request from "../utils/request.js";

export type paginate = {
    page:number
    per_page:number
}
export function getUser(params:paginate){
    return request({
        url: '/user/',
        method: 'get',
        params
    })
}
export function deleteUser(id:number){
    return request({
        url: `/user/${id}`,
        method: 'delete',
    })
}
export function updatePassWord(params:any){
    return request({
        url: `/user/password/${params.id}`,
        method: 'patch',
        data:params
    })
}

export function createUser(params:any){
    return request({
        url: `/user/store`,
        method: 'post',
        data:params
    })
}
export function updateUser(params:any,id:number){
    return request({
        url: `/user/update/${id}`,
        method: 'patch',
        data:params
    })
}

export function getUserShow(id:number){
    return request({
        url: `/user/${id}`,
        method: 'get',
    })
}
